home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / dsielink / frmdemo3.fr_ (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-03-16  |  7.5 KB  |  219 lines

  1. VERSION 5.00
  2. Object = "{03B95A9D-DBDD-11D2-87A3-97F32F5E191C}#1.1#0"; "DSIELink.ocx"
  3. Begin VB.Form FrmDemo3 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "Demo of the URL link control.."
  6.    ClientHeight    =   3735
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   7170
  10.    Icon            =   "FrmDemo3.frx":0000
  11.    LinkTopic       =   "FrmDemo3"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   3735
  15.    ScaleWidth      =   7170
  16.    StartUpPosition =   2  'CenterScreen
  17.    Begin VB.Frame Frames 
  18.       Caption         =   "URL Saving..."
  19.       Height          =   2295
  20.       Index           =   1
  21.       Left            =   3960
  22.       TabIndex        =   8
  23.       Top             =   1320
  24.       Width           =   3135
  25.       Begin VB.CheckBox DatForce 
  26.          Caption         =   "&Visited"
  27.          Height          =   255
  28.          Left            =   2040
  29.          TabIndex        =   13
  30.          Top             =   1680
  31.          Width           =   855
  32.       End
  33.       Begin VB.CommandButton BtnReset 
  34.          Caption         =   "&Reset"
  35.          Height          =   375
  36.          Index           =   1
  37.          Left            =   240
  38.          TabIndex        =   9
  39.          Top             =   1680
  40.          Width           =   1095
  41.       End
  42.       Begin DSIELink.IELink Links 
  43.          Height          =   225
  44.          Index           =   1
  45.          Left            =   120
  46.          TabIndex        =   10
  47.          Top             =   1320
  48.          Width           =   1365
  49.          _ExtentX        =   2408
  50.          _ExtentY        =   397
  51.          Caption         =   "Open the Harddisk"
  52.          URL             =   "C:\"
  53.          Hover           =   0   'False
  54.          IESync          =   3
  55.          SaveURL         =   -1  'True
  56.          Picture         =   "FrmDemo3.frx":0442
  57.          HoverPicture    =   "FrmDemo3.frx":0B70
  58.          VisitedPicture  =   "FrmDemo3.frx":129E
  59.       End
  60.       Begin DSIELink.IELink Links 
  61.          Height          =   225
  62.          Index           =   2
  63.          Left            =   1680
  64.          TabIndex        =   12
  65.          Top             =   1320
  66.          Width           =   1365
  67.          _ExtentX        =   2408
  68.          _ExtentY        =   397
  69.          Caption         =   "Open the Harddisk"
  70.          URL             =   "C:\"
  71.          Hover           =   0   'False
  72.          IESync          =   3
  73.          Picture         =   "FrmDemo3.frx":19CC
  74.          HoverPicture    =   "FrmDemo3.frx":20FA
  75.          VisitedPicture  =   "FrmDemo3.frx":2828
  76.       End
  77.       Begin VB.Label LblLabels 
  78.          AutoSize        =   -1  'True
  79.          Caption         =   $"FrmDemo3.frx":2F56
  80.          Height          =   975
  81.          Index           =   3
  82.          Left            =   120
  83.          TabIndex        =   11
  84.          Top             =   240
  85.          Width           =   2850
  86.          WordWrap        =   -1  'True
  87.       End
  88.    End
  89.    Begin VB.Frame Frames 
  90.       Caption         =   "Graphics..."
  91.       Height          =   2295
  92.       Index           =   0
  93.       Left            =   120
  94.       TabIndex        =   2
  95.       Top             =   1320
  96.       Width           =   3735
  97.       Begin VB.CommandButton BtnReset 
  98.          Caption         =   "&Reset"
  99.          Height          =   375
  100.          Index           =   0
  101.          Left            =   120
  102.          TabIndex        =   7
  103.          Top             =   1320
  104.          Width           =   1095
  105.       End
  106.       Begin DSIELink.IELink Links 
  107.          Height          =   705
  108.          Index           =   0
  109.          Left            =   120
  110.          TabIndex        =   5
  111.          Top             =   360
  112.          Width           =   1065
  113.          _ExtentX        =   1879
  114.          _ExtentY        =   1244
  115.          URL             =   "C:\"
  116.          Style           =   3
  117.          SaveURL         =   -1  'True
  118.          Picture         =   "FrmDemo3.frx":3009
  119.          HoverPicture    =   "FrmDemo3.frx":3737
  120.          VisitedPicture  =   "FrmDemo3.frx":3E65
  121.       End
  122.       Begin VB.Label LblLabels 
  123.          AutoSize        =   -1  'True
  124.          Caption         =   $"FrmDemo3.frx":4593
  125.          Height          =   1560
  126.          Index           =   2
  127.          Left            =   1320
  128.          TabIndex        =   6
  129.          Top             =   480
  130.          Width           =   2250
  131.          WordWrap        =   -1  'True
  132.       End
  133.    End
  134.    Begin VB.CommandButton BtnDemo 
  135.       Caption         =   "&Demo Form 1"
  136.       Height          =   375
  137.       Index           =   0
  138.       Left            =   4800
  139.       TabIndex        =   1
  140.       Top             =   120
  141.       Width           =   1095
  142.    End
  143.    Begin VB.CommandButton BtnDemo 
  144.       Caption         =   "Demo &Form 2"
  145.       Height          =   375
  146.       Index           =   1
  147.       Left            =   6000
  148.       TabIndex        =   0
  149.       Top             =   120
  150.       Width           =   1095
  151.    End
  152.    Begin VB.Image ImgLogo 
  153.       Height          =   480
  154.       Left            =   120
  155.       Picture         =   "FrmDemo3.frx":467C
  156.       Top             =   120
  157.       Width           =   480
  158.    End
  159.    Begin VB.Label LblLabels 
  160.       AutoSize        =   -1  'True
  161.       Caption         =   $"FrmDemo3.frx":4986
  162.       Height          =   780
  163.       Index           =   0
  164.       Left            =   720
  165.       TabIndex        =   4
  166.       Top             =   120
  167.       Width           =   3690
  168.       WordWrap        =   -1  'True
  169.    End
  170.    Begin VB.Label LblLabels 
  171.       AutoSize        =   -1  'True
  172.       Caption         =   "This form demonstrates the URL saving feature and then Graphics feature of the control"
  173.       Height          =   255
  174.       Index           =   1
  175.       Left            =   120
  176.       TabIndex        =   3
  177.       Top             =   1080
  178.       Width           =   6330
  179.       WordWrap        =   -1  'True
  180.    End
  181. Attribute VB_Name = "FrmDemo3"
  182. Attribute VB_GlobalNameSpace = False
  183. Attribute VB_Creatable = False
  184. Attribute VB_PredeclaredId = True
  185. Attribute VB_Exposed = False
  186. Option Explicit
  187. Private Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long
  188. Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
  189. Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
  190. Private Sub BtnDemo_Click(Index As Integer)
  191.     Me.Hide
  192.     If Index = 0 Then
  193.         FrmDemo1.Show
  194.     Else
  195.         FrmDemo2.Show
  196.     End If
  197. End Sub
  198. Private Sub DatForce_Click()
  199.     FrmDemo3.Links(2).ForceVisited = (FrmDemo3.DatForce.Value = 1)
  200. End Sub
  201. Private Sub Form_Unload(Cancel As Integer)
  202.     End
  203. End Sub
  204. Private Sub BtnReset_Click(Index As Integer)
  205.     'This is a cheat that enables the URL to appear to be
  206.     'unvisited
  207.     'Do not try to replicate this behaviour in your programs
  208.     'Certain URLs are coded in the Registry and should
  209.     'not be tampered with - mess about at your own peril!!
  210.     Dim hKey As Long
  211.     If RegOpenKey(&H80000001, "Software\Dave Software\URLs\ActiveX\Visited", hKey) <> 0 Then Exit Sub
  212.     RegDeleteValue hKey, "c:\"
  213.     RegCloseKey hKey
  214.     'It is necessary to make the controls repaint themselves
  215.     'URLs were never intended to be "unvisited"
  216.     FrmDemo3.Links(0).Color = RGB(0, 0, 255)
  217.     FrmDemo3.Links(1).Color = RGB(0, 0, 255)
  218. End Sub
  219.